/***************************************************************************
 *            compress.c
 *
 *  dim. novembre 11 21:51:52 2012
 *  Copyright  2012  Esprit
 *  <anouar.chemek@esprit.tn>
 ****************************************************************************/
/*
 * iosms.h
 *
 * Copyright (C) 2012 - Esprit
	 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
	 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */


void compRLE(char sms[],char compSms[])
{
	int i=0,j=0,k=0;
	int count;

	while (sms[i]!='\0')
	{
		k=i;
		count=1;
		while((sms[k]==sms[k+1]))
		{
			count++;
			k++;
		}
		
		compSms[j]=(char)('0' + count);
		j++;
		compSms[j]=sms[i];
		j++;
		
		i=k+1;
	}
	compSms[j]='\0';
}

void decompRLE(char compsms[],char sms[])
{
	

}
